The C programming language is a widely-used, general-purpose, imperative computer programming language. C supports structured programming, lexical variable scope and recursion. C implements a static type system. C has built-in features that enable efficient mapping to typical machine instructions, and because of this, is frequently used instead of assembly language and for operating systems, in addition to its use in application software. In C, executable code is packaged into subroutines, called “functions”. C program source text is free-format. The semicolon is used as a statement terminator. Curly braces are used to group blocks of statements.
A common example of a C program is the “hello, world” program:
#include <stdio.h>int main(void){printf(“hello, world\n”);}The first line of the program includes the preprocessing directive, “#include”. The preprocessor of the compiler will replace the “#include <stdio.h>” line with the contents of the stdio.h file. The stdio.h file is a standard header. A header includes declarations for functions (e.g., stdio.h includes the declaration for the function “printf”).
The C programming language can be extended using libraries. A C library is a collection of functions in a file. Each library typically includes a header file. The header file includes the prototypes of the functions included in the library that can be used by a program. The header file can also include declarations of special data types and macro symbols used with these functions. To use a library, a program includes the name of the library's header file. During compilation, the library is linked with the program.
A number of programming languages have been based on C, including but not limited to C++, and MIDL (Microsoft Interface Definition Language). C++ is a Turing-complete general purpose programming language that supports object-oriented programming MIDL is a programming language that can be used to define interfaces between client and server programs. MIDL enables developers to create the interface definition language (IDL) files and application configuration files (ACF) required for remote procedure call (RPC) interfaces and COM/DCOM (Component Object Model/Distributed Component Object Model) interfaces. MIDL also supports the generation of type libraries for OLE (Object Linking and Embedding) Automation.